package com.dom.invoapp.dao.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.dom.invoapp.dao.entity.TStorInfo;
import com.dom.invoapp.dao.mapper.TStorInfoMapper;
import com.dom.invoapp.dao.service.ITStorInfoService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * B_仓库信息表 服务实现类
 * </p>
 *
 * @author xllei
 * @since 2018-11-17
 */
@Service
public class TStorInfoServiceImpl extends ServiceImpl<TStorInfoMapper, TStorInfo> implements ITStorInfoService {

    @Override
    public List<TStorInfo> selectInfoList(int memId) {
        Wrapper<TStorInfo> wrapper = new EntityWrapper<>();
        return selectList(wrapper);
    }

    @Override
    public Map<String, String> getStorInfoToMap() {
        Wrapper<TStorInfo> wrapper = new EntityWrapper<>();
        List<TStorInfo> list = this.selectList(wrapper);
        Map<String,String> map = new HashMap<>();
        for (TStorInfo info: list) {
            map.put(info.getStorCode().toString(),info.getStorAbbr());
        }
        return map;
    }
}
